<html>

<head>
  <title></title>
</head>

<?php
require "ab.inc.php";

	   $sqlcmd="select * from mustrid order by id";
       $result=mysql_query($sqlcmd);

       $m=array();

       while($myrow = mysql_fetch_array($result))
       {
           if  ($myrow["kuvamine"]==1)
            {
                array_push($m, $myrow["pilt"]);
            }

       }

$random = array_rand($m);
$pilt00 = $m[$random];
mysql_close();

require "ab.inc.php";

	   $sqlcmd="select*from mustrid order by id";
       $result=mysql_query($sqlcmd);

       $m=array();

       while($myrow = mysql_fetch_array($result))
       {
           if  ($myrow["kuvamine"]==1 & $myrow["pilt"] != $pilt00)
            {
                array_push($m, $myrow["pilt"]);
            }

       }

$random = array_rand($m);
$pilt11 = $m[$random];
mysql_close();

require "ab.inc.php";

	   $sqlcmd="select*from mustrid order by id";
       $result=mysql_query($sqlcmd);

       $m=array();

       while($myrow = mysql_fetch_array($result))
       {
           if  ($myrow["kuvamine"]==1 & $myrow["pilt"] != $pilt00 & $myrow["pilt"] != $pilt11)
            {
                array_push($m, $myrow["pilt"]);
            }

       }

$random = array_rand($m);
$pilt22 = $m[$random];
mysql_close();

require "ab.inc.php";

	   $sqlcmd="select*from mustrid order by id";
       $result=mysql_query($sqlcmd);

       $m=array();

       while($myrow = mysql_fetch_array($result))
       {
           if  ($myrow["kuvamine"]==1 & $myrow["pilt"] != $pilt00 & $myrow["pilt"] != $pilt11 & $myrow["pilt"] != $pilt22)
            {
                array_push($m, $myrow["pilt"]);
            }

       }

$random = array_rand($m);
$pilt33 = $m[$random];
mysql_close();

require "ab.inc.php";

	   $sqlcmd="select*from mustrid order by id";
       $result=mysql_query($sqlcmd);

       $m=array();

       while($myrow = mysql_fetch_array($result))
       {
           if  ($myrow["kuvamine"]==1 & $myrow["pilt"] != $pilt00 & $myrow["pilt"] != $pilt11 & $myrow["pilt"] != $pilt22 & $myrow["pilt"] != $pilt33)
            {
                array_push($m, $myrow["pilt"]);
            }

       }

$random = array_rand($m);
$pilt44=$m[$random];
mysql_close();


echo "<body background=imgs/".$pilt00.">

<table width=900 height=900 align=center valign=middle>
<tr>

<td background=imgs/".$pilt11." align=center valign=middle>

<table width=600 height=600 align=center valign=middle>
<tr>

<td background=imgs/".$pilt22." align=center valign=middle>

<table width=300 height=300 align=center valign=middle>
<tr>

<td background=imgs/".$pilt33." align=center valign=middle>

<table width=50 height=50 align=center valign=middle>
<tr>

<td background=imgs/".$pilt44." class=kiri align=center valign=middle>
       <a href=\"index.php\"><img src=\"tyhi.gif\" width=44 height=44 border=0></a>
</td>

</tr>
</table>

</td>

</tr>
</table>

</td>

</tr>
</table>

</td>

</tr>
</table>";

?>

</body>

</html>